<template>
    <div>
        <el-tree-select v-bind="$attrs" :filter-node-method="filterMethod"  filterable :data="data"
            :props="props" :render-after-expand="false" check-strictly />
    </div>
</template>
<script setup>
import { getUnitTree } from '@/api/manage/units-manager/units-manager/index';
import { usePageVariablesStoreHook } from '@/store/modules/pageVariables'
const data = ref([]);
const value = ref()
const props = {
    label: 'unityName',
    value: 'id',
    children: 'childs',
}
getUnitTree({ unityId: usePageVariablesStoreHook().getManage()?.unityId }).then(res => {
    data.value.push(...res.result.data)
})
const filterMethod = (value, data) => data.unityName.includes(value)
</script>
<style lang="scss" scoped></style>